<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SKaP: CI_Encrypt Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SKaP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_c_i___encrypt.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">CI_Encrypt Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a095c5d389db211932136b53f25f39685"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a095c5d389db211932136b53f25f39685">__construct</a> ()</td></tr>
<tr class="separator:a095c5d389db211932136b53f25f39685"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad3fd0de27f6a67b14751b47d2471693"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aad3fd0de27f6a67b14751b47d2471693">get_key</a> ($key= '')</td></tr>
<tr class="separator:aad3fd0de27f6a67b14751b47d2471693"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec193abfe69c2cb1af185b3ca5754de3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aec193abfe69c2cb1af185b3ca5754de3">set_key</a> ($key= '')</td></tr>
<tr class="separator:aec193abfe69c2cb1af185b3ca5754de3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d863b1bc39b9a7865d99df1cdf24df0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a3d863b1bc39b9a7865d99df1cdf24df0">encode</a> ($string, $key= '')</td></tr>
<tr class="separator:a3d863b1bc39b9a7865d99df1cdf24df0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60c68c6c16a6082e23386f9ac23518ef"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a60c68c6c16a6082e23386f9ac23518ef">decode</a> ($string, $key= '')</td></tr>
<tr class="separator:a60c68c6c16a6082e23386f9ac23518ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dffd202d3b3968d905d1012041e6588"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a2dffd202d3b3968d905d1012041e6588">encode_from_legacy</a> ($string, $legacy_mode=MCRYPT_MODE_ECB, $key= '')</td></tr>
<tr class="separator:a2dffd202d3b3968d905d1012041e6588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e12266a879a6258c49dbc380aed35ca"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a6e12266a879a6258c49dbc380aed35ca">_xor_encode</a> ($string, $key)</td></tr>
<tr class="separator:a6e12266a879a6258c49dbc380aed35ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0cee348c5cef9a3a06c22a92c38fd4f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aa0cee348c5cef9a3a06c22a92c38fd4f">_xor_decode</a> ($string, $key)</td></tr>
<tr class="separator:aa0cee348c5cef9a3a06c22a92c38fd4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf2644aeb5ec418eb4ddc2d70f372ada"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aaf2644aeb5ec418eb4ddc2d70f372ada">_xor_merge</a> ($string, $key)</td></tr>
<tr class="separator:aaf2644aeb5ec418eb4ddc2d70f372ada"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1d7e40f65deb526fe4619da65c6b1ec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aa1d7e40f65deb526fe4619da65c6b1ec">mcrypt_encode</a> ($data, $key)</td></tr>
<tr class="separator:aa1d7e40f65deb526fe4619da65c6b1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85f02c928abbbc5a6bf038ea5292324d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a85f02c928abbbc5a6bf038ea5292324d">mcrypt_decode</a> ($data, $key)</td></tr>
<tr class="separator:a85f02c928abbbc5a6bf038ea5292324d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada423e99876a54e7bc33afc9899d01a2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ada423e99876a54e7bc33afc9899d01a2">_add_cipher_noise</a> ($data, $key)</td></tr>
<tr class="separator:ada423e99876a54e7bc33afc9899d01a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35c2675b85803d42231d1f8353fa8dac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a35c2675b85803d42231d1f8353fa8dac">_remove_cipher_noise</a> ($data, $key)</td></tr>
<tr class="separator:a35c2675b85803d42231d1f8353fa8dac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6459059d757a362410feb13d96455747"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a6459059d757a362410feb13d96455747">set_cipher</a> ($cipher)</td></tr>
<tr class="separator:a6459059d757a362410feb13d96455747"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab32fd90a4ac2df4be1e56460d6f6daa3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ab32fd90a4ac2df4be1e56460d6f6daa3">set_mode</a> ($mode)</td></tr>
<tr class="separator:ab32fd90a4ac2df4be1e56460d6f6daa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a663ee049f0b7596a0e4925a3eb2db062"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a663ee049f0b7596a0e4925a3eb2db062">_get_cipher</a> ()</td></tr>
<tr class="separator:a663ee049f0b7596a0e4925a3eb2db062"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c6526d9458754249ee7268ead883a6c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a8c6526d9458754249ee7268ead883a6c">_get_mode</a> ()</td></tr>
<tr class="separator:a8c6526d9458754249ee7268ead883a6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab14b774f9fd0cc2fd082a2c44c5f9f07"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ab14b774f9fd0cc2fd082a2c44c5f9f07">set_hash</a> ($type= '<a class="el" href="class_c_i___encrypt.html#a0cd7cd589a363e34549991c27584b489">sha1</a>')</td></tr>
<tr class="separator:ab14b774f9fd0cc2fd082a2c44c5f9f07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea8db0058c00fd2bc1351ddb2ebf3191"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aea8db0058c00fd2bc1351ddb2ebf3191">hash</a> ($str)</td></tr>
<tr class="separator:aea8db0058c00fd2bc1351ddb2ebf3191"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cd7cd589a363e34549991c27584b489"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a0cd7cd589a363e34549991c27584b489">sha1</a> ($str)</td></tr>
<tr class="separator:a0cd7cd589a363e34549991c27584b489"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ae0314d046ddf7fcfaec03222977427d3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ae0314d046ddf7fcfaec03222977427d3">$CI</a></td></tr>
<tr class="separator:ae0314d046ddf7fcfaec03222977427d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35bbf76a5bcca90ca9b39368ed28121c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a35bbf76a5bcca90ca9b39368ed28121c">$encryption_key</a> = ''</td></tr>
<tr class="separator:a35bbf76a5bcca90ca9b39368ed28121c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04e9d4ea0e45fc04c07aa1e291e17412"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#a04e9d4ea0e45fc04c07aa1e291e17412">$_hash_type</a> = '<a class="el" href="class_c_i___encrypt.html#a0cd7cd589a363e34549991c27584b489">sha1</a>'</td></tr>
<tr class="separator:a04e9d4ea0e45fc04c07aa1e291e17412"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf4246798dad057cc4e294706e5e4e37"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#aaf4246798dad057cc4e294706e5e4e37">$_mcrypt_exists</a> = FALSE</td></tr>
<tr class="separator:aaf4246798dad057cc4e294706e5e4e37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2cdedd99c4818b191c667f5e081a2db"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ab2cdedd99c4818b191c667f5e081a2db">$_mcrypt_cipher</a></td></tr>
<tr class="separator:ab2cdedd99c4818b191c667f5e081a2db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace4d98b5320c7fe75e6a38505abcdb82"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_i___encrypt.html#ace4d98b5320c7fe75e6a38505abcdb82">$_mcrypt_mode</a></td></tr>
<tr class="separator:ace4d98b5320c7fe75e6a38505abcdb82"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a095c5d389db211932136b53f25f39685"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__construct </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructor</p>
<p>Simply determines whether the mcrypt library exists. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ada423e99876a54e7bc33afc9899d01a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_add_cipher_noise </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adds permuted noise to the IV + encrypted data to protect against Man-in-the-middle attacks on CBC mode ciphers <a href="http://www.ciphersbyritter.com/GLOSSARY.HTM#IV">http://www.ciphersbyritter.com/GLOSSARY.HTM#IV</a></p>
<p>Function description</p>
<p>private </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a663ee049f0b7596a0e4925a3eb2db062"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_get_cipher </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get Mcrypt cipher Value</p>
<p>private </p>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a8c6526d9458754249ee7268ead883a6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_get_mode </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get Mcrypt Mode Value</p>
<p>private </p>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a35c2675b85803d42231d1f8353fa8dac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_remove_cipher_noise </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Removes permuted noise from the IV + encrypted data, reversing <a class="el" href="class_c_i___encrypt.html#ada423e99876a54e7bc33afc9899d01a2">_add_cipher_noise()</a></p>
<p>Function description</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>type </dd></dl>

</div>
</div>
<a class="anchor" id="aa0cee348c5cef9a3a06c22a92c38fd4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_xor_decode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>XOR Decode</p>
<p>Takes an encoded string and key as input and generates the plain-text original message</p>
<p>private </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a6e12266a879a6258c49dbc380aed35ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_xor_encode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>XOR Encode</p>
<p>Takes a plain-text string and key as input and generates an encoded bit-string using XOR</p>
<p>private </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="aaf2644aeb5ec418eb4ddc2d70f372ada"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">_xor_merge </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>XOR key + string Combiner</p>
<p>Takes a string and key as input and computes the difference using XOR</p>
<p>private </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a60c68c6c16a6082e23386f9ac23518ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">decode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em> = <code>''</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decode</p>
<p>Reverses the above process</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a3d863b1bc39b9a7865d99df1cdf24df0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">encode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em> = <code>''</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encode</p>
<p>Encodes the message string using bitwise XOR encoding. The key is combined with a random hash, and then it too gets converted using XOR. The whole thing is then run through mcrypt (if supported) using the randomized key. The end result is a double-encrypted message string that is randomized with each call to this function, even if the supplied message and key are the same.</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>the string to encode </td></tr>
    <tr><td class="paramname">string</td><td>the key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a2dffd202d3b3968d905d1012041e6588"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">encode_from_legacy </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$legacy_mode</em> = <code>MCRYPT_MODE_ECB</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em> = <code>''</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encode from Legacy</p>
<p>Takes an encoded string from the original Encryption class algorithms and returns a newly encoded string using the improved method added in 2.0.0 This allows for backwards compatibility and a method to transition to the new encryption algorithms.</p>
<p>For more details, see <a href="http://codeigniter.com/user_guide/installation/upgrade_200.html#encryption">http://codeigniter.com/user_guide/installation/upgrade_200.html#encryption</a></p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">int</td><td>(mcrypt mode constant) </td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="aad3fd0de27f6a67b14751b47d2471693"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_key </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em> = <code>''</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Fetch the encryption key</p>
<p>Returns it as MD5 in order to have an exact-length 128 bit key. Mcrypt is sensitive to keys that are not the correct length</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="aea8db0058c00fd2bc1351ddb2ebf3191"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hash </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Hash encode a string</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a85f02c928abbbc5a6bf038ea5292324d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mcrypt_decode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypt using Mcrypt</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="aa1d7e40f65deb526fe4619da65c6b1ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mcrypt_encode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encrypt using Mcrypt</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a6459059d757a362410feb13d96455747"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_cipher </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$cipher</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the Mcrypt Cipher</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">constant</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="ab14b774f9fd0cc2fd082a2c44c5f9f07"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_hash </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$type</em> = <code>'<a class="el" href="class_c_i___encrypt.html#a0cd7cd589a363e34549991c27584b489">sha1</a>'</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the Hash type</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="aec193abfe69c2cb1af185b3ca5754de3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_key </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em> = <code>''</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the encryption key</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

</div>
</div>
<a class="anchor" id="ab32fd90a4ac2df4be1e56460d6f6daa3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_mode </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$mode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the Mcrypt Mode</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">constant</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a0cd7cd589a363e34549991c27584b489"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sha1 </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate an SHA1 Hash</p>
<p>public </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>

</div>
</div>
<h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a04e9d4ea0e45fc04c07aa1e291e17412"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$_hash_type = '<a class="el" href="class_c_i___encrypt.html#a0cd7cd589a363e34549991c27584b489">sha1</a>'</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ab2cdedd99c4818b191c667f5e081a2db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$_mcrypt_cipher</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aaf4246798dad057cc4e294706e5e4e37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$_mcrypt_exists = FALSE</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ace4d98b5320c7fe75e6a38505abcdb82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$_mcrypt_mode</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ae0314d046ddf7fcfaec03222977427d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$CI</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a35bbf76a5bcca90ca9b39368ed28121c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">$encryption_key = ''</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>C:/xampp/htdocs/skap/system/libraries/<a class="el" href="_encrypt_8php.html">Encrypt.php</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_c_i___encrypt.html">CI_Encrypt</a></li>
    <li class="footer">Generated on Thu Nov 29 2012 09:50:45 for SKaP by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
